<?php
include_once("config/DB.php");
class Umbrella
{
	private $id;
	private $type;//0为短柄，暂定只有短柄
	private $state;//0为完好，1为轻微损坏，2为不可用
	private $code;
	public function __construct($code)
	{
		$db= new DB();
		$db->getDB("sql_flyingwings");
		$result= $db->select("Umbrella",'*',"code='".$code."'")[0];//for example
		
		$this->id=$result['id'];
		$this->type=$result['type'];
		$this->state=$result['state'];
		$this->code=$code;
	}
	public function getID()
	{
		return $this->id;
	}
	public function getType()
	{
		return $this->type;
	}
	public function getState()
	{
		return $this->state;
	}
	public function getCode()
	{
		return $this->code;
	}
}


